﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Model.aspx.cs" Inherits="GreatB2C.Web.Manage.SystemSet.Contents.Model" %>

<%@ Register src="../../../Controls/TemplateSelect.ascx" tagname="TemplateSelect" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>内容模型添加/修改</title>
    <link href="../../../App_Themes/AdminDefaultTheme/Guide.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/index.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/xtree.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/MasterPage.css" type="text/css"
        rel="stylesheet" />

    <script type="text/javascript" src="../../../Resource/Script/pagebase.js"></script>

    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/icon.css" />

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery-1.4.4.min.js"></script>

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery.easyui.min.js"></script>

    <script src="../../../Resource/Script/jquery.validate.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        window.onload = function() {
            // validate signup form on keyup and submit
            $("#form1").validate({
                rules: {
                    txtModelName: {
                        required: true
                    },
                    txtTableName: {
                        required: true
                    },
                    txtItemName: {
                        required: true
                    },
                    txtItemUnit: {
                        required: true
                    },
                    txtAddInfoFilePath: {
                        required: true
                    },
                    txtManageInfoFilePath: {
                        required: true
                    },
                    txtPreviewInfoFilePath: {
                        required: true
                    },
                    txtBatchInfoFilePath: {
                        required: true
                    }
                },
                messages: {
                    txtModelName: {
                        required: "<font class='validatemsg'>* 内容模型名称不能为空</font>"
                    },
                    txtTableName: {
                        required: "<font class='validatemsg'>* 数据表名不能为空</font>"
                    },
                    txtItemName: {
                        required: "<font class='validatemsg'>* 项目名称不能为空</font>"
                    },
                    txtItemUnit: {
                        required: "<font class='validatemsg'>* 项目单位不能为空</font>"
                    },
                    txtAddInfoFilePath: {
                        required: "<font class='validatemsg'>* 信息发布文件不能为空</font>"
                    },
                    txtManageInfoFilePath: {
                        required: "<font class='validatemsg'>* 信息管理文件不能为空</font>"
                    },
                    txtPreviewInfoFilePath: {
                        required: "<font class='validatemsg'>* 信息预览文件不能为空</font>"
                    },
                    txtBatchInfoFilePath: {
                        required: "<font class='validatemsg'>* 信息量设置文件不能为空</font>"
                    }
                }
            });
        }
    </script>
    <style type="text/css">
        .tree-node
        {
            height:23px;
            line-height:23px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <span style="display: inline-block; height: 20px;">
        <span>
            <img src="../../../App_Themes/AdminDefaultTheme/Images/localGIF.gif" align="absmiddle"
                style="border-width: 0px;" />后台管理 </span><span>&gt;&gt; </span><span><a>系统设置</a></span><span>
                    &gt;&gt; </span><span><a>模型管理</a></span><span> &gt;&gt; </span><span><a>
                        <asp:Label ID="lblPath" runat="server" Text="添加内容模型"></asp:Label></a></span></span>
    <table class="border" width="100%" cellpadding="2" cellspacing="1">
        <tr>
            <td class="spacingtitle" colspan="2" align="center">
                <asp:Label ID="lblTitle" runat="server" Text="添加内容模型"></asp:Label>
            </td>
        </tr>
        <tr class="tdbg" runat="server" id="trModelTemmpalteId">
            <td class="tdbgleft">
                <strong>载入内容模型模板：</strong>
            </td>
            <td>
                <asp:DropDownList ID="ddlModelTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" style="width: 35%">
                <strong>内容模型名称：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtModelName" runat="server" MaxLength="200" CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>创建的数据表名：</strong>
                <br /><span style='color: red'>注意：</span>创建表后将无法再更改表名称
            </td>
            <td>
                <asp:Label ID="lblTablePrefix" runat="server" Text="PE_U_" />
                <asp:TextBox ID="txtTableName" runat="server" MaxLength="50" CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" />
                <asp:RegularExpressionValidator ID="ValeTableName" runat="server" ControlToValidate="txtTableName"
                    ErrorMessage="只允许输入字母、数字或下划线" ValidationExpression="^[\w_]+$" SetFocusOnError="true"
                    Display="Dynamic" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>项目名称：</strong>
                <br />
                例如：文章、软件、图片、商品
            </td>
            <td>
                <asp:TextBox ID="txtItemName" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="20" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>项目单位：</strong>
                <br />
                例如：篇、个、件
            </td>
            <td>
                <asp:TextBox ID="txtItemUnit" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="20" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>项目图标：</strong>
                <br />
                图标存放在~/Resource/Images/ModelIcon/目录下
            </td>
            <td>
                <asp:TextBox ID="txtItemIcon" Text="Default.gif" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="20" />
                <asp:Image ID="ImgItemIcon" runat="server" ImageUrl="~/Resource/Images/ModelIcon/Default.gif" />
                <=<asp:DropDownList ID="ddlItemIcon" runat="server" onchange="ChangeTxtItemIcon(this.value);" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>模型描述：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"
                    Height="43px" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>默认内容页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucContentTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>打印页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucPrintTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>栏目搜索页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucSearchTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>高级搜索表单页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucAdvanceSearchFormTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>高级搜索页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucAdvanceSearchTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>查看评论模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucCommentManageTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>会员中心用户发表信息页模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucUserAddContentTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>匿名投稿模板：</strong>
            </td>
            <td>
                <uc1:TemplateSelect ID="ucAnonymouseAddContentTemplate" runat="server" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>信息发布文件：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtAddInfoFilePath" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="200" Text="Content.aspx" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>信息管理文件：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtManageInfoFilePath" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="200"
                    Text="ContentManage.aspx" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>信息预览文件：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtPreviewInfoFilePath" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="200"
                    Text="ContentView.aspx" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>信息批量设置文件：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtBatchInfoFilePath" runat="server"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" MaxLength="200"
                    Text="ContentBatch.aspx" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>自定义内容发布和管理页注意事项：</strong>
            </td>
            <td style="width: 80%">
                如果以上四项使用了自定义的程序文件，请将文件存放在“~/Manage/Contents/”目录下。
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否统计点击数：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radIsCountHits" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Selected="True" Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否禁用：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radDisabled" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否启用收费：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radEnableCharge" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>生成静态页时的收费提示：</strong><br />
                支持HTML代码，特别标签有：<br />
                {$ModelName} 模型名称<br />
                {$FileName} 文件夹名<br />
                {$Id} 信息的GeneralId<br />
            </td>
            <td>
                <asp:TextBox ID="txtModelChargeTips" TextMode="MultiLine" MaxLength="255"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"
                    Height="53px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>
                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>点卷数额不足时的收费提示：</strong><br />
                支持HTML代码，特别标签有：<br />
                {$InfoPoint} 需要点卷数<br />
                {$ItemName} 项目名称 {$NowPoint} 会员点卷<br />
                {$PointName} 点卷名称 {$PointUnit} 点卷单位<br />
            </td>
            <td>
                <asp:TextBox ID="txtNeedPointChargeTips" TextMode="MultiLine" MaxLength="255"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"
                    Height="53px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr class="tdbg" runat="server" id="EnableOutTimeChargeTips">
            <td class="tdbgleft">
                <strong>有效期不足时的收费提示：</strong><br />
                支持HTML代码，特别标签有：<br />
                {$ItemName} 项目名称<br />
            </td>
            <td>
                <asp:TextBox ID="txtOutTimeChargeTips" TextMode="MultiLine" MaxLength="255"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"
                    Height="53px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr class="tdbg" runat="server" id="EnableUsePointChargeTips">
            <td class="tdbgleft">
                <strong>查看收费信息时的收费提示：</strong><br />
                支持HTML代码，特别标签有：<br />
                {$url} 阅读跳转路径 {$ItemName} 项目名称<br />
                {$PointUnit} 点卷单位 {$NowPoint} 会员点卷<br />
                {$InfoPoint} 需要点卷数 {$PointName} 点卷名称<br />
                {$FinalPoint} 剩余点卷数 {$InstallDir} 不阅读虚拟路径<br />
            </td>
            <td>
                <asp:TextBox ID="txtUsePointChargeTips" TextMode="MultiLine" MaxLength="255"  CssClass="inputtext" Width="400px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"
                    Height="53px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否启用签收：</strong><br />
                开启签收需要在内容页模板中添加如下标签：{PE.Label id="内容签收" itemId="@RequestInt_id" /}
            </td>
            <td>
                <asp:RadioButtonList ID="radEnableSignin" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>是否启用投票：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radVote" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>用户前台发表信息是否开启验证码：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radEnableVerificationCode" runat="server" RepeatDirection="Horizontal"
                    RepeatLayout="Flow">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>用户在此模型下发表内容的限制数：</strong>
                <br />
                此限制数是为用户在该模型下发表所有文章数来计算的，设为0表示没有限制。
            </td>
            <td>
                <asp:TextBox ID="txtMaxPerUser" runat="server" MaxLength="6" Text="0" Width="36" CssClass="inputtext" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';" />个内容
            </td>
        </tr>
        <tr class="tdbg" id="TrEnalbeWap" runat="server" visible="false">
            <td class="tdbgleft" style="width: 35%">
                <strong>是否启用WAP功能：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radEnableWap" runat="server" RepeatDirection="Horizontal"
                    onclick="wapSelect()" RepeatLayout="Flow">
                    <asp:ListItem Value="True">是</asp:ListItem>
                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr id="TrFeildparallelism" class="tdbg" runat="server">
            <td class="tdbgleft" colspan="2">
                <table class="border" width="100%" border="0" style="margin: 0 auto;" cellpadding="2"
                    cellspacing="1">
                    <tr class="tdbg">
                        <td class="tdbgleft">
                            <strong>WAP字段</strong>
                        </td>
                        <td>
                            <strong>对应内容模型字段</strong>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 35%">
                            <strong>标题(Title)</strong>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlTitle" runat="server" DataTextField="FieldName" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 35%">
                            <strong>内容(Content)</strong>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlContent" runat="server" DataTextField="FieldName" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 35%">
                            <strong>作者(Author)</strong>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlAuthor" runat="server" DataTextField="FieldName" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbgleft" style="width: 35%">
                            <strong>状态(Status)</strong>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlStatus" runat="server" DataTextField="FieldName" DataValueField="ID">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr class="tdbgbottom">
            <td colspan="2">
                <asp:Button ID="BtnSubmit" runat="server" Text="添 加[S]" class="btnstyle_blue" Style="width: 70px;"
                    AccessKey="S" onmouseover="this.className='btnstyle_blue_over'" onmouseout="this.className='btnstyle_blue'"
                    OnClick="BtnSubmit_Click" />&nbsp;&nbsp;
                <input type="reset" name="ClearSiteInfo" value="重 填[R]" class="btnstyle_blue" id="btnSiteInfoReset"
                    accesskey="R" style="width: 70px;" runat="server" onmouseover="this.className='btnstyle_blue_over'"
                    onmouseout="this.className='btnstyle_blue'" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="HdnModelId" runat="server" />
    <asp:HiddenField ID="HdnModelName" runat="server" />
    <asp:HiddenField ID="HdnTableName" runat="server" />

    <script type="text/javascript">
        function wapSelect() {
            var TrFeildparallelism = $("#TrFeildparallelism");
            var RadEnableWap = $("#RadEnableWap input");
            if (RadEnableWap.attr("checked")) {
                TrFeildparallelism.show();
            }
            else {
                TrFeildparallelism.hide();
            }
        }

        function ChangeTxtItemIcon(icon) {
            document.getElementById("txtItemIcon").value = icon;
            document.getElementById("ImgItemIcon").src = "../../../Resource/Images/ModelIcon/" + icon;
        }
        function CheckLength(obj, maxLength) {
            if (obj.value.length > maxLength) {
                obj.value = obj.value.substring(0, maxLength - 1);
                alert("字符长度不能超过" + maxLength + "个字符");
            }
        }
    </script>

    </form>
    <asp:Literal ID="litScript" runat="server"></asp:Literal>
</body>
</html>
